<%@ page language="java" contentType="text/html;charset=utf-8"
	pageEncoding="utf-8"%>

<%@ include file="/core/taglibs2.jsp"%>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%@ include file="/core/adminTopMeta.jsp"%>
<script type="text/javascript">
			 
			   
		function loginNameChange(){
			
			var loginName=$("#loginName").val(); 	
			 
			 
			//第一种：json传过来的是list 
			<%-- $.getJSON("<%=basePath%>/admin/member/ajaxGetMemberListByName.shtml",{loginName: loginName},function(result){	 
				//填入新值
				//alert(result.rows);
				 
				$.each(result.rows, function(i,f){
				 	 
					$(".test111").append("<tr><td>"+f.loginName+"</td><td>"+f.personName+"</td><td>"+f.recommendNum+"</td></tr>");
					
					
				});
			}); --%>
			
			//第二种：json传过来的是HashMap
			$.getJSON("<%=basePath%>/admin/member/ajaxGetMemberListByName.shtml",{loginName: loginName},function(result){	 
				//填入新值
				//alert(result.rows);
				//list转json对象
				var json=JSON.stringify(result.maxList); 
				alert(json); 
				$.each(result.list, function(i,f){
				 	 
					$(".test111").append("<tr><td>"+f.loginName+"</td><td>"+f.personName+"</td><td>"+f.recommendNum+"</td></tr>");
					
					
				});
			});
			 
			
		}
	</script> 


</head>

<body oncontextmenu="return false"><div class="loader"></div>
	<div class="row">
		<div class="col-md-12">
			<div class="panel">
				<div class="panel-heading text-primary">
					<h3 class="panel-title">
						<i class="fa fa-group"></i> 测试Ajax <span class="pull-right">
							<div class="btn-group code">
								<a href="#" class="dropdown-toggle" data-toggle="dropdown"
									title="Classes used"> </a>

							</div> </span>
					</h3>
				</div>
				
				<!-- /panel body -->
			</div>
		</div>
		 
		<div class="col-md-12">
			<div class="panel panel-primary">
				<div class="panel-heading">
					<h3 class="panel-title  text-white" style="font-size: 17px;">
						测试Ajax
					</h3>
				</div>
				<div class="panel-body">
<form name="commitForm" id="commitForm" method="post" action="admin/member/memberNoActiveList.shtml">
					 
					<table class="table table-bordered  table-striped " id="example">
						 <tr>
								<td align="right" width="20%">
									代理商编号：
								</td>
								<td align="left"  width="30%">
									<input type="text"  id="loginName" name="loginName"  onchange="loginNameChange()" />
									<span id="loginNamePersonName"></span> 
								</td>
								 
							   
							</tr>
					</table>
		 			 
					<table class="table table-bordered table-hover table-striped display test111" id="example">
						<thead>
   
							<tr class="info">
						
								<th>账号</th>
								<th>姓名</th>
								<th>直推人数</th>
								 
							</tr>
						</thead>
					 
						 
					</table>
					<div style="text-align: center;"><page:pageControl /></div>
</form>
				</div>
			</div>
			<!-- / Info Panel -->
			 
		</div>
		 
		<!-- /col-md-12 -->
	</div>
	<!--代码高亮end-->
	
	
	
</body>
</html>